<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-CN">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.3" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.3">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.3">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.3">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.3" color="#222">





  <meta name="keywords" content="Hexo, NexT" />





  <link rel="alternate" href="/atom.xml" title="Likianta Blog" type="application/atom+xml" />






<meta name="description" content="本文讲解“结束”按钮被触发时的效果。学习本次实例将会让你进一步了解AE脚本的知识。">
<meta property="og:type" content="article">
<meta property="og:title" content="106 创建本条字幕的结束时间">
<meta property="og:url" content="https://likianta.coding.me/2018/0131-225215/index.html">
<meta property="og:site_name" content="Likianta Blog">
<meta property="og:description" content="本文讲解“结束”按钮被触发时的效果。学习本次实例将会让你进一步了解AE脚本的知识。">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://ozurciydg.bkt.clouddn.com/18-2-1/56149924.jpg">
<meta property="og:image" content="http://ozurciydg.bkt.clouddn.com/18-2-1/74768526.jpg">
<meta property="og:updated_time" content="2018-02-11T12:37:10.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="106 创建本条字幕的结束时间">
<meta name="twitter:description" content="本文讲解“结束”按钮被触发时的效果。学习本次实例将会让你进一步了解AE脚本的知识。">
<meta name="twitter:image" content="http://ozurciydg.bkt.clouddn.com/18-2-1/56149924.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.3',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://likianta.coding.me/2018/0131-225215/"/>





  <title>106 创建本条字幕的结束时间 | Likianta Blog</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Likianta Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tutorials">
          <a href="/tags/tutorial-catalog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            教程
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://likianta.coding.me/2018/0131-225215/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Likianta">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="http://ozurciydg.bkt.clouddn.com/18-2-12/72826549.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Likianta Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">106 创建本条字幕的结束时间</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-01-31T22:52:15+08:00">
                2018-01-31
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/lk-ae-subtitlescript/" itemprop="url" rel="index">
                    <span itemprop="name">LK字幕脚本开发</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  1,062
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  4
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>本文讲解“结束”按钮被触发时的效果。学习本次实例将会让你进一步了解AE脚本的知识。</p>
<a id="more"></a>
<h1 id="“结束”按钮触发逻辑图"><a href="#“结束”按钮触发逻辑图" class="headerlink" title="“结束”按钮触发逻辑图"></a>“结束”按钮触发逻辑图</h1><p><img src="http://ozurciydg.bkt.clouddn.com/18-2-1/56149924.jpg" alt=""></p>
<h1 id="详细代码-onBtn2Click"><a href="#详细代码-onBtn2Click" class="headerlink" title="详细代码 onBtn2Click()"></a>详细代码 onBtn2Click()</h1><p>下面会贴出完整的代码，详细的注解会在<code>//</code>中给出。</p>
<blockquote>
<p>如需回顾其他章节的函数或者理解更深入，可以参考本套教程附加的文档：  </p>
<ul>
<li><a href="https://likianta.coding.me/2018/0131-155529/">LK脚本开发相关语法参考</a>  </li>
<li><a href="https://likianta.coding.me/2018/0131-154538/">Adobe脚本代码书写规范</a></li>
</ul>
<p>以及官方文档（结合文末的参考页码查阅）：  </p>
<ul>
<li>JavaScript Tools Guide CC.pdf  </li>
<li>After Effects CS6 Scripting Guide.pdf</li>
</ul>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="comment">// LK字幕生成工具（LK Subtitle Generator）</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">function</span> <span class="title">LK_SubtitleGenerator</span>(<span class="params">thisObj</span>)</span></span><br><span class="line"><span class="function">    </span>&#123; </span><br><span class="line">        ...</span><br><span class="line"></span><br><span class="line">        <span class="function"><span class="keyword">function</span> <span class="title">onBtn2Click</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="comment">// 主要目标：创建本条字幕的结束时间</span></span><br><span class="line"></span><br><span class="line">            <span class="comment">// 判断本条字幕的结束时间是否已存在，若存在则新建一条字幕；不存在（默认情况）则给当前字幕赋予结束值</span></span><br><span class="line">            <span class="keyword">if</span> (last_time == <span class="string">""</span>) &#123;</span><br><span class="line">                <span class="keyword">if</span> (id &gt; <span class="number">0</span>) &#123;</span><br><span class="line">                    s = app.project.item(INDEX).time; <span class="comment">// 获取当前时间（格式为“30.1134467801134”）</span></span><br><span class="line">                    s = timeToCurrentFormat(s, FPS); <span class="comment">// 转换时间格式（转换为“00:00:30:02”）</span></span><br><span class="line">                    item = listbox.items[id<span class="number">-1</span>]; <span class="comment">// 获取当前字幕（也就是列表中最后一条字幕，注意列表是从0开始数的）</span></span><br><span class="line">                    item.subItems[<span class="number">1</span>].text = s; <span class="comment">// 赋予当前时间到`end`列</span></span><br><span class="line">                    last_time = item.subItems[<span class="number">1</span>].text; <span class="comment">// 记录此次操作的item（略）和time，以供后续回调</span></span><br><span class="line">                    </span><br><span class="line">                &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                    <span class="comment">// 若当前字幕的`id`=0，说明用户打算在第一条就去创建结束时间</span></span><br><span class="line">                    <span class="comment">// 这个操作是不允许的，我们会给出一个警告窗口提示用户“先定义一个开始时间”</span></span><br><span class="line">                    alert(<span class="string">"Please define a start time first."</span>, <span class="string">"Warning"</span>);</span><br><span class="line">                &#125;</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123; <span class="comment">// 若当前字幕时间值不为空，则新建一条字幕再赋值</span></span><br><span class="line">                content = edt.text;</span><br><span class="line">                <span class="comment">// 检查文本是否为空，为空则中止操作，不为空则继续</span></span><br><span class="line">                <span class="keyword">if</span> (content == <span class="string">''</span>) &#123;</span><br><span class="line">                    alert(<span class="string">"Please input some contents"</span>, <span class="string">"Warning"</span>);</span><br><span class="line">                &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                    <span class="comment">// 新建字幕编号</span></span><br><span class="line">                    id += <span class="number">1</span>;</span><br><span class="line">    </span><br><span class="line">                    <span class="comment">// 个位数需要进行补零操作：01, 02, 03...</span></span><br><span class="line">                    <span class="keyword">if</span> (id &lt; <span class="number">10</span>) &#123;</span><br><span class="line">                        item = listbox.add(<span class="string">'item'</span>,<span class="string">'0'</span> + id);</span><br><span class="line">                    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                        item = listbox.add(<span class="string">'item'</span>, id);</span><br><span class="line">                    &#125;</span><br><span class="line">    </span><br><span class="line">                    <span class="comment">// 获取当前时间并赋值给`end`列</span></span><br><span class="line">                    s = app.project.item(INDEX).time;</span><br><span class="line">                    s = timeToCurrentFormat(s, FPS);</span><br><span class="line">                    item.subItems[<span class="number">0</span>].text = last_time; <span class="comment">// 使本条字幕的start时间 = 上条字幕的end时间</span></span><br><span class="line">                    item.subItems[<span class="number">1</span>].text = s;</span><br><span class="line">                    item.subItems[<span class="number">2</span>].text = content;</span><br><span class="line"></span><br><span class="line">                    <span class="comment">// 列表滚动到底部</span></span><br><span class="line">                    listbox.revealItem(item);</span><br><span class="line"></span><br><span class="line">                    <span class="comment">// 记得文字上屏后要把编辑框内的文字清空</span></span><br><span class="line">                    edt.text = <span class="string">""</span>;</span><br><span class="line"></span><br><span class="line">                    <span class="comment">// 记录此次操作的item和time，以供后续回调</span></span><br><span class="line">                    last_item = item;</span><br><span class="line">                    last_time = item.subItems[<span class="number">1</span>].text;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        ...</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    LK_SubtitleGenerator(<span class="keyword">this</span>); <span class="comment">// 执行该函数</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h1 id="改进：解决btn-2按钮按下后不能及时显示到“end”列的问题"><a href="#改进：解决btn-2按钮按下后不能及时显示到“end”列的问题" class="headerlink" title="改进：解决btn_2按钮按下后不能及时显示到“end”列的问题"></a>改进：解决btn_2按钮按下后不能及时显示到“end”列的问题</h1><p>运行刚才写好的代码，从下面的动图很容易发现一个问题：</p>
<p><img src="http://ozurciydg.bkt.clouddn.com/18-2-1/74768526.jpg" alt=""></p>
<p>当我们点击结束按钮时，“end”列并没有立刻显示结束时间，但当我们手动点了其他控件（或者切换窗口）后，“end”中的时间才会显示出来。</p>
<p>这说明btn_2的事件的确被执行了，但是却不知为何出现了莫名其妙的“延迟”。</p>
<p>经过多次测试，这个“延迟”的问题一直得不到很好的解决。</p>
<p>下面仅提供一个权宜的解决方法（新增两行代码）：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="comment">// LK字幕生成工具（LK Subtitle Generator）</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">function</span> <span class="title">LK_SubtitleGenerator</span>(<span class="params">thisObj</span>)</span></span><br><span class="line"><span class="function">    </span>&#123; </span><br><span class="line">        ...</span><br><span class="line"></span><br><span class="line">        <span class="function"><span class="keyword">function</span> <span class="title">onBtn2Click</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="comment">// 主要目标：创建本条字幕的结束时间</span></span><br><span class="line"></span><br><span class="line">            <span class="keyword">if</span> (last_time == <span class="string">""</span>) &#123;</span><br><span class="line">                <span class="keyword">if</span> (id &gt; <span class="number">0</span>) &#123;</span><br><span class="line">                    ...</span><br><span class="line"></span><br><span class="line">                    <span class="comment">// 强制激活“end”列，使时间码立即显示</span></span><br><span class="line">                    s = listbox.add(<span class="string">'item'</span>, <span class="string">''</span>); <span class="comment">// “临时”新建一条空字幕</span></span><br><span class="line">                    listbox.remove(s); <span class="comment">// 随即又把它删除</span></span><br><span class="line">                &#125;</span><br><span class="line">            &#125; ...</span><br><span class="line"></span><br><span class="line">            ...</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        ...</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    LK_SubtitleGenerator(<span class="keyword">this</span>); <span class="comment">// 执行该函数</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>该方法通过临时地新建一条空字幕，随即又把它删除，从而迫使<code>listbox</code>强制夺走<code>btn_2</code>的焦点，使<code>listbox</code>的UI被立即更新。</p>
<p>此方法虽然可以解决问题，但明显不属于正常操作。希望有大神能给出更加好的方法。</p>
<blockquote>
<p>下章链接：<a href="https://likianta.coding.me/2018/0201-140116/">107 删除字幕操作</a></p>
</blockquote>
<hr>
<h1 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h1><ul>
<li><strong>JavaScript Tools Guide CC</strong><ul>
<li>notify - p82</li>
<li>scroll into view if necessary - p139,145</li>
<li>remove item - p145</li>
</ul>
</li>
<li><strong>After Effects CS6 Scripting Guide</strong></li>
</ul>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
        <div class="post-widgets">
        

        

        
          
          <div id="needsharebutton-postbottom">
            <span class="btn">
              <i class="fa fa-share-alt" aria-hidden="true"></i>
            </span>
          </div>
        
        </div>
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/0131-160058/" rel="next" title="AE脚本 app.project.item(index) 讲解">
                <i class="fa fa-chevron-left"></i> AE脚本 app.project.item(index) 讲解
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/0201-140116/" rel="prev" title="107 删除字幕操作">
                107 删除字幕操作 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zNDI4MS8xMDgxOA=="></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="http://ozurciydg.bkt.clouddn.com/18-2-12/72826549.jpg"
                alt="Likianta" />
            
              <p class="site-author-name" itemprop="name">Likianta</p>
              <p class="site-description motion-element" itemprop="description">Android Dev</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">73</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">2</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="http://blog.csdn.net/likianta" target="_blank" title="CSDN">
                      
                        <i class="fa fa-fw fa-crosshairs"></i>CSDN</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:sheerish@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/likianta" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/5441767757/profile?rightmod=1&wvr=6&mod=personinfo" target="_blank" title="Weibo">
                      
                        <i class="fa fa-fw fa-weibo"></i>Weibo</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#“结束”按钮触发逻辑图"><span class="nav-text">“结束”按钮触发逻辑图</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#详细代码-onBtn2Click"><span class="nav-text">详细代码 onBtn2Click()</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#改进：解决btn-2按钮按下后不能及时显示到“end”列的问题"><span class="nav-text">改进：解决btn_2按钮按下后不能及时显示到“end”列的问题</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#参考"><span class="nav-text">参考</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; 2017 &mdash; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Likianta</span>

  
</div>


  <div class="powered-by">
    <i class="fa fa-user-md"></i>
    <span id="busuanzi_container_site_pv">
      Site visitors:<span id="busuanzi_value_site_pv"></span>
    </span>
  </div>

<!--
  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Mist</a> v5.1.3</div>

-->



<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">Site words total count:75.2k</span>
</div>
        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.3"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.3"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.3"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.3"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.3"></script>



  


  




	





  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  












  





  

  

  

  
  
  
  <link rel="stylesheet" href="/lib/needsharebutton/needsharebutton.css">

  
  
  <script src="/lib/needsharebutton/needsharebutton.js"></script>

  <script>
    
      pbOptions = {};
      
          pbOptions.iconStyle = "box";
      
          pbOptions.boxForm = "horizontal";
      
          pbOptions.position = "bottomCenter";
      
          pbOptions.networks = "Weibo,Wechat,Douban,QQZone,Evernote";
      
      new needShareButton('#needsharebutton-postbottom', pbOptions);
    
    
  </script>

  

  

  

  

</body>
</html>
